const FlakeIdGen = require('flake-idgen');
const intformat = require('biguint-format');


function createSnow(data) {
    const generator = new FlakeIdGen({ datacenterId: data, workerId: 1 });
    const id = generator.next();
    const snowflake = intformat(id, 'dec');
    return snowflake;
}

module.exports = {
    createSnow
}